#include "helper.h"

void zySetPugiResult(pugi::xml_parse_result* res, PMDATA_INF pArgInf)
{
	if (pArgInf->m_dtDataType != _SDT_NULL)
	{
		epugi_xml_parer_result* pRes = (epugi_xml_parer_result*)*pArgInf->m_ppCompoundData;
		if (pRes->description)
		{
			MFree(pRes->description);
		}
		MFree(*pArgInf->m_ppCompoundData);
		epugi_xml_parer_result* ptr = (epugi_xml_parer_result*)MMalloc(sizeof(epugi_xml_parer_result));
		ptr->status = res->status;
		ptr->offset = res->offset;
		ptr->encoding = res->encoding;
		ptr->description = CloneTextData(res->description());
		*pArgInf->m_ppCompoundData = ptr;
	}
}

